<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>网站后台管理系统</title>
<meta name="keywords" content="">
<meta name="description" content="">
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="css/ie6.css"/>
<![endif]-->
<link rel="stylesheet" type="text/css"  href="../../../../public/layui/css/layui.css">
<link href="../../../../public/admin/css/style_v2.0.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/layui/css/layui.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/style_v2.0.css" />
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/layui/layui.js"></script>
</head>
<body>
<div class="position mt10">当前位置：<a href="{:U('Index/main')}">后台首页</a> > <a href="{:U('Customer/index')}">客户列表</a></div>
<div id="container">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  <legend>客户信息</legend>
</fieldset>
<div class="layui-form">
    <div class="layui-btn-group">
         <a href="{:U('Customer/index')}" class="layui-btn layui-btn-big"><i class="layui-icon">&#xe60a;</i>客户列表</a>&nbsp;
         <button class="layui-btn layui-btn-big"  data-method="notice" ><i class="layui-icon">&#xe654;</i> 添加客户</button>&nbsp;
         <!--<a href="{:U('Custome/export/')}"  class="layui-btn layui-btn-big layui-btn-normal"><i class="layui-icon">&#xe62d;</i> 导出报表</a>&nbsp;-->
    </div>
</div>
<!--高级搜索-->
<div class="c"></div>
<div class="layui-form" style="background-color:#FFFFFF;">
<table class="layui-table" id="table">
    <thead>
    <tr style="text-align:center;">
      <th style="text-align:center;"></th>
      <th style="text-align:center;">客户姓名</th>
      <th style="text-align:center;">客户电话</th>
      <th style="text-align:center;">微信</th>
      <th style="text-align:center;">QQ</th>
      <th style="text-align:center;">状态</th>
      <th colspan="2" style="text-align:center;">操作</th>
    </tr> 
    </thead>
    <form id="form2" name="form2" method="post" action="{:U('Admin/Customer/customer_del/')}">  
     <volist name="list" id="r">
    <tr>
      <td  align="center" class="layui-form-item"><input type="checkbox" id="cid[]" title="{$r.cid}"  lay-skin="primary"  name="cid[]" value="{$r.cid}"/></td>
      <td align="center" height="22px">{$r.cuname}</td>
      <td align="center" height="22px">{$r.cphone}</td>
      <td  align="center">{$r.cwechat}</td>
      <td  align="center" >{$r.cqq}</td>
      <td  align="center"><if condition="$r['status'] eq 0"><font color="red">不合作</font><else /><font color="009688">正常</font></if></td>
      <td  align="center"><a href="{:U('Admin/Customer/customer_edit/',array('cid' => $r['cid']))}" title="编辑" class="layui-btn layui-btn-small"><i class="layui-icon">&#xe642;</i></a><a href="{:U('Admin/Customer/customer_del',array('cid' => $r['cid']))}" class="layui-btn layui-btn-small layui-btn-danger" title="删除" onClick="return checkConfirm('您确认删除记录?')"><i class="layui-icon">&#xe640;</i></a></td>
    </tr>
    </volist>
    <tr>
      <td align="center"><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose"></td>
      <td colspan="10">
      <div style="padding-left:20px;">  
         <input type="button" value="全选" name="selectall" class="layui-btn" />
         <input type="button" value="反选" name="selectno" class="layui-btn "/>
         <button  name="btnDel" lay-submit="" lay-filter="btnDel" class="layui-btn layui-btn-danger" />删除</button>
      </div>      </td>
    </tr>
   </form>
    </table>
    <div class="c"></div>
    <div id="pages">{$page}</div>      
</div>
</div>
</body>
</html>
<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
<form name=reg action="{:U('Admin/Customer/customer_update')}"  enctype="multipart/form-data"  method="post"  class="layui-form" id="customer_add" style="display:none;">
<div class="layui-form">
    <table class="layui-table">
    <tr>
	  <td width="20%" align="right"><font color=red size="1">·</font>客户姓名：</td>
	  <td width="80%">
      <span class="table_span" style="width:300px; float:left;"><input name="cuname" type="text" id="cuname" value="" required  lay-verify="" placeholder="客户姓名" autocomplete="off" class="layui-input"></span>
      <span class="table_txt"></span>
      </td>
    </tr>
    <tr>
	  <td width="20%" align="right"><font color=red size="1">·</font>客户电话：</td>
	  <td width="80%">
      <span class="table_span" style="width:300px; float:left;">
      <input name="cphone" type="text" id="cphone" value=""   lay-verify="cphone" placeholder="客户电话" autocomplete="off" class="layui-input"></span>
      </td>
    </tr>
    <tr>
	  <td align="right"><font color=red size="1">·</font>客户微信：</td>
	  <td>
      <span class="table_span" style="width:300px; float:left;"><input name="cwechat" type="text" id="cwechat" value=""  lay-verify="" placeholder="客户微信" autocomplete="off" class="layui-input"></span>
      </td>
    </tr>
    <tr>
	  <td align="right"><font color=red size="1">·</font>客户QQ：</td>
	  <td><span class="table_span" style="width:300px; float:left;"><input name="cqq" type="text" id="cqq" value=""  lay-verify="" placeholder="客户QQ" autocomplete="off" class="layui-input"></span>
      </td>
    </tr>
    <tr>
	  <td align="right">客户类型：</td>
	  <td><span class="table_span" style="width:300px; padding-left:0px;">
          <select name="ctype" lay-verify="" lay-filter="">
          <option value="">请选择账号</option>
           <option value="1">直属客户</option>
           <option value="2">渠道</option>
           </volist>
        </select>
      </span>
      </td>
    </tr>
    <tr>
	  <td align="right">其他信息：</td>
	  <td><span class="table_span" style="width:300px; float:left;"><textarea name="content" type="text" id="content" value=""  lay-verify="" placeholder="其他信息" autocomplete="off" class="layui-textarea" style="height:60px;"></textarea></span>
      </td>
    </tr>
    <tr>
	     <td align="right">排序：</td>
	     <td><span class="table_txt"><input type="text" name="listorder" value="0" class="layui-input" style="width:50px;"></span>
            <span class="table_txt"><font color="#666666">（越大越靠前）</font></span></td>
        </tr>
	   <td align="right"><font color=red size="1">·</font>添加时间：</td>
	  <td><input name="inputtime" type="text" id="inputtime" value="{$now|date='Y-m-d H:i:s',###}"  autocomplete="off"  class="layui-input ico-date"  style="width:250px; float:left;"></td>
	  </tr>
    <tr> 
	  <td colspan=2 align="center" valign="middle">
		<input type="submit" name="Submit" value="确&nbsp; &nbsp;定" class="layui-btn" >
		<input type="reset" name="Submit2" value="重　置" class="layui-btn layui-btn-primary" >		 </td>
	</tr>
    </table>
</div>
</form>

<script>
//Demo
layui.use(['form','laydate'], function(){
  var form = layui.form
  laydate  = layui.laydate;
   var active = {
       notice: function(){
		  layer.open({
			type: 1
			,title: '新增客户' //不显示标题栏
			,closeBtn: 2
			,area: ['600px','590px']
			,shade: 0.4
			,id: 'LAY_layuipro' //设定一个id，防止重复弹出
			//,btn: ['提交', '关闭']
			,btnAlign: 'c'
			,moveType: 1 //拖拽模式，0或者1
			,content: $("#customer_add"),
            })
       }
   }
   
    $('.layui-btn-group .layui-btn').on('click', function(){
		var othis = $(this), method = othis.data('method');
		active[method] ? active[method].call(this, othis) : '';
	  });
	  
   laydate.render({
       elem: '#inputtime'
	   ,type: 'datetime'
  });
   
  //监听提交
  form.on('submit(btnDel)', function(data){
    //layer.msg(JSON.stringify(data.field));
	title: '最终的提交信息'
	return true;
  });

});
</script>
